package com.petShop.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.petShop.mappers.CartMapper;
import com.petShop.models.Cart;

@Repository
public class CartDao{
	@Autowired
	CartMapper cartMapper;

	public void insertCart(Cart cart) {
		cartMapper.insertCart(cart);
	}
	
	public void insertSomeToCart(Cart cart) {
		cartMapper.insertSomeToCart(cart);
	}

	public Cart selectCart(Cart cart) {
		return cartMapper.selectCart(cart);
	}

	public List<Cart> selectCarts(int userId) {
		return cartMapper.selectCarts(userId);
	}

	public void addCart(Cart cart) {
		cartMapper.addCart(cart);
	}
	
	public void addSome(Cart cart) {
		cartMapper.addSome(cart);
	}

	public void remove(Cart cart) {
		cartMapper.remove(cart);	
	}

	public void clear(Cart cart) {
		cartMapper.clear(cart);
	}

	public void clearAll(int userId) {
		cartMapper.clearAll(userId);
	}
}
